﻿Imports DTO
Imports System.Data.OleDb
Public Class CHocKyDAO

    Public Function LayDanhSachHocKy() As List(Of CHocKyDTO)
        Dim cnn As OleDbConnection = CDaTaProviderDAO.ConnectDB()
        cnn.Open()
        Dim _strselect = "select TenHocKy from HOCKY"
        Dim _cmd As New OleDbCommand(_strselect, cnn)
        Dim _reader As OleDbDataReader = _cmd.ExecuteReader()
        Dim _danhsachhk As New List(Of CHocKyDTO)
        While _reader.Read()
            Dim _HKdto As New CHocKyDTO()
            _HKdto.TenHocKy = _reader.GetInt32(0)
            _danhsachhk.Add(_HKdto)
        End While
        cnn.Close()
        Return _danhsachhk
    End Function
End Class
